// 预约状态枚举
export const APPOINTMENT_STATUS = {
  TO_SIGN_IN: { value: 0, label: "待签到" },
  SIGNED_IN: { value: 1, label: "已签到" },
  CANCELLED: { value: 2, label: "已取消" },
  COMPLETED: { value: 3, label: "已完成" },
  NO_SHOW: { value: 4, label: "爽约" },
};

// 获取预约状态选项数组（用于下拉框）
export function getAppointmentStatusOptions() {
  return Object.values(APPOINTMENT_STATUS);
}

// 根据值获取预约状态标签
export function getAppointmentStatusLabel(value) {
  const status = Object.values(APPOINTMENT_STATUS).find(item => item.value === value);
  return status ? status.label : '未知状态';
}

// 预约状态映射对象（用于dict-tag组件）
export const APPOINTMENT_STATUS_MAP = Object.values(APPOINTMENT_STATUS).reduce((map, item) => {
  map[item.value] = item.label;
  return map;
}, {});